<?php

namespace app\admin\controller;

use app\admin\model\User;
use app\common\controller\Backend;

class Dashboard extends Backend
{
    public function initialize(): void
    {
        parent::initialize();
    }

    public function index(): void
    {
        $user_count=(new User())->where('group_id',1)->count('id');
        $dodayuser_count=(new User())->where('group_id',1)->whereTime('join_time','today')->count('id');
        $shop_count=(new User())->where('group_id',2)->count('id');
        $order_count=(new \app\admin\model\Orders())->count('id');
        $this->success('', [
            'remark' => get_route_remark(),
            'user_count' => $user_count,
            'shop_count' => $shop_count,
            'order_count' => $order_count,
            'todayuser_count' => $dodayuser_count,
        ]);
    }
}